package com.binvshe.binvshe.mine;


import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;

import com.binvshe.binvshe.R;
import com.binvshe.binvshe.common.huanxin_im.ChatHelper;
import com.pachong.android.baseuicomponent.fragment.BaseFragment;
import com.pachong.android.frameworkbase.customviews.BadgeRadioButton;
import com.pachong.android.frameworkbase.customviews.BadgeView;

import butterknife.Bind;
import butterknife.OnClick;

/**
 * A simple {@link Fragment} subclass.
 */
public class TestFragment extends BaseFragment {


    @Bind(R.id.mImgSetting)
    ImageView mImgSetting;
    @Bind(R.id.rbtnTest)
    BadgeRadioButton rbtnTest;

    public TestFragment() {
    }


    @Override

    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        View view = super.onCreateView(inflater, container, savedInstanceState);

        BadgeView mMyDotView = new BadgeView(getContext());
        mMyDotView.setTargetView(mImgSetting);//就是这里
        mMyDotView.setBackgroundResource(com.pachong.android.frameworkbase.R.drawable.ic_launcher);
        return view;
    }

    @Override
    public View createDataView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        return inflater.inflate(R.layout.frag_test, null);
    }

    @Override
    public void onResume() {
        super.onResume();
    }

    @OnClick({R.id.mImgSetting, R.id.rbtnTest})
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.mImgSetting:
                //设置

//                String userName = "13017667217";
//                String userName = "15959234090";
                                String userName = "18888880003";
//                startActivity(new Intent(getActivity(), ChatActivity.class).putExtra(EaseConstant.EXTRA_USER_ID, userName));

                ChatHelper.startSingleChat(getActivity(), userName);

           /*     Intent intent = new Intent(getActivity(), ChatActivity.class);
                intent.putExtra(EaseConstant.EXTRA_USER_ID, "128");
                intent.putExtra(EaseConstant.EXTRA_CHAT_TYPE, EaseConstant.CHATTYPE_GROUP);
                startActivity(intent);*/

//                EaseConstant.EXTRA_CHAT_TYPE, EaseConstant.CHATTYPE_SINGLE

                break;

            case R.id.rbtnTest:

                break;

        }
    }

}